import request from '@/utils/request'

// 查询采购入库单明细列表
export function listReceiptItem(query) {
  return request({
    url: '/purchase/receiptItem/list',
    method: 'get',
    params: query
  })
}

// 查询采购入库单明细详细
export function getReceiptItem(itemId) {
  return request({
    url: '/purchase/receiptItem/' + itemId,
    method: 'get'
  })
}

// 新增采购入库单明细
export function addReceiptItem(data) {
  return request({
    url: '/purchase/receiptItem',
    method: 'post',
    data: data
  })
}

// 修改采购入库单明细
export function updateReceiptItem(data) {
  return request({
    url: '/purchase/receiptItem',
    method: 'put',
    data: data
  })
}

// 删除采购入库单明细
export function delReceiptItem(itemId) {
  return request({
    url: '/purchase/receiptItem/' + itemId,
    method: 'delete'
  })
}

// 根据入库单ID查询明细列表
export function listReceiptItemByReceiptId(receiptId) {
  return request({
    url: '/purchase/receiptItem/listByReceiptId/' + receiptId,
    method: 'get'
  })
}

// 批量新增采购入库单明细
export function batchAddReceiptItem(data) {
  return request({
    url: '/purchase/receiptItem/batchAdd',
    method: 'post',
    data: data
  })
}

// 根据入库单ID删除明细
export function delReceiptItemByReceiptId(receiptId) {
  return request({
    url: '/purchase/receiptItem/deleteByReceiptId/' + receiptId,
    method: 'delete'
  })
}